Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add WFC3 notebook 'calwf3_recal_tvb.ipynb' #99

Merged
merged 21 commits into from
Nov 28, 2023

Conversation

dulude
Copy link
Collaborator

@dulude dulude commented Oct 5, 2023

Relevant Tickets


This notebook checklist has been made available to us by the Notebooks For All team.
Its purpose is to serve as a guide for both the notebook author and the technical reviewer highlighting critical aspects to consider when striving to develop an accessible and effective notebook.

The First Cell

  • The title of the notebook in a first-level heading (eg. <h1> or # in markdown).
  • A brief description of the notebook.
  • A table of contents in an ordered list (1., 2., etc. in Markdown).
  • The author(s) and affiliation(s) (if relevant).
  • The date first published.
  • The date last edited (if relevant).
  • A link to the notebook's source(s) (if relevant).

The Rest of the Cells

  • There is only one H1 (# in Markdown) used in the notebook.
  • The notebook uses other heading tags in order (meaning it does not skip numbers).

Text

  • All link text is descriptive. It tells users where they will be taken if they open the link.
  • All acronyms are defined at least the first time they are used.
  • Field-specific/specialized terms are used when needed, but not excessively.

Code

  • Code sections are introduced and explained before they appear in the notebook. This can be fulfilled with a heading in a prior Markdown cell, a sentence preceding it, or a code comment in the code section.
  • Code has explanatory comments (if relevant). This is most important for long sections of code.
  • If the author has control over the syntax highlighting theme in the notebook, that theme has enough color contrast to be legible.
  • Code and code explanations focus on one task at a time. Unless comparison is the point of the notebook, only one method for completing the task is described at a time.

Images

  • All images (jpg, png, svgs) have an image description. This could be

    • Alt text (an alt property)
    • Empty alt text for decorative images/images meant to be skipped (an alt attribute with no value)
    • Captions
    • If no other options will work, the image is decribed in surrounding paragraphs.
  • Any text present in images exists in a text form outside of the image (this can be alt text, captions, or surrounding text.)

Visualizations

  • All visualizations have an image description. Review the previous section, Images, for more information on how to add it.

  • Visualization descriptions include

    • The type of visualization (like bar chart, scatter plot, etc.)
    • Title
    • Axis labels and range
    • Key or legend
    • An explanation of the visualization's significance to the notebook (like the trend, an outlier in the data, what the author learned from it, etc.)
  • All visualizations and their parts have enough color contrast (color contrast checker) to be legible. Remember that transparent colors have lower contrast than their opaque versions.

  • All visualizations convey information with more visual cues than color coding. Use text labels, patterns, or icons alongside color to achieve this.

  • All visualizations have an additional way for notebook readers to access the information. Linking to the original data, including a table of the data in the same notebook, or sonifying the plot are all options.


Fred's notes for wfc3_calwf3_recalibration_notebook:

  • Removed notebook from _config
  • Added notebook to _toc
  • Small grammar update in README
  • Added crds to requirements
  • Added pre-requirements to install hstcal
  • Updated notebook to PEP8 standards

@dulude dulude added the WFC3 Wide Field Camera 3 label Oct 5, 2023
@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@FDauphin
Copy link
Contributor

@haticekaratay @camipacifici @dulude I was able to pass the PEP8 style check, but failed the Notebook Execution and Validation.

  • In the raw .ipynb file, the Python version under metadata is 3.8.12, but CI is "Set up" in Python 3.11. Should I update that to Python 3.11?
  • Under "Execute notebooks", the CI returns a FileExistsError when I try to make a local directory named orig/. How can this subdirectory already exist?
  • The final error is under "Checkout only the file to the target branch". If the other two issues above are resolved, will this also resolve?

I appreciate any help towards fixing these small bugs

@FDauphin
Copy link
Contributor

FDauphin commented Nov 20, 2023

@haticekaratay @camipacifici @dulude I was able to pass the PEP8 style check, but failed the Notebook Execution and Validation.

  • In the raw .ipynb file, the Python version under metadata is 3.8.12, but CI is "Set up" in Python 3.11. Should I update that to Python 3.11?
  • Under "Execute notebooks", the CI returns a FileExistsError when I try to make a local directory named orig/. How can this subdirectory already exist?
  • The final error is under "Checkout only the file to the target branch". If the other two issues above are resolved, will this also resolve?

I appreciate any help towards fixing these small bugs

Hi @haticekaratay @dulude , I saw in #100 that the pre-requirements.sh bug was resolved so I came back here to check if the CI ran again. There were some minor conflicts that I resolved and the CI ran again, with all checks passing. However, it still produces an error on my second bullet point. Why would it pass if it found an error, and is it ok for review? I appreciate all the help!

@haticekaratay
Copy link
Collaborator

@haticekaratay @camipacifici @dulude I was able to pass the PEP8 style check, but failed the Notebook Execution and Validation.

  • In the raw .ipynb file, the Python version under metadata is 3.8.12, but CI is "Set up" in Python 3.11. Should I update that to Python 3.11?
  • Under "Execute notebooks", the CI returns a FileExistsError when I try to make a local directory named orig/. How can this subdirectory already exist?
  • The final error is under "Checkout only the file to the target branch". If the other two issues above are resolved, will this also resolve?

I appreciate any help towards fixing these small bugs

Hi @haticekaratay @dulude , I saw in #100 that the pre-requirements.sh bug was resolved so I came back here to check if the CI ran again. There were some minor conflicts that I resolved and the CI ran again, with all checks passing. However, it still produces an error on my second bullet point. Why would it pass if it found an error, and is it ok for review? I appreciate all the help!

Thanks, @FDauphin, for bringing to attention the issue of the CI showing all green checks despite errors. This issue has been reported to the CI team( @dulude, @mgough-970). Apart from that, I've provided some suggestions for enhancing the notebook. Thanks again for your work.

@@ -55,20 +55,18 @@
"This notebook assumes you have created the virtual environment in [WFC3 Library's](https://github.com/spacetelescope/WFC3Library) installation instructions.\n",
Copy link
Collaborator

@haticekaratay haticekaratay Nov 24, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In reviewing the part of the notebook where files are being renamed and moved, I'd like to suggest a small enhancement for clarity. The code snippet uses os.path.basename and os.path.join to handle file paths which is great practice for cross-platform compatibility and code readability.

for im in science_files:
  root = os.path.basename(im)
  new_path = os.path.join('.', root)
  os.rename(im, new_path)

data_directory......



Reply via ReviewNB

@@ -55,20 +55,18 @@
"This notebook assumes you have created the virtual environment in [WFC3 Library's](https://github.com/spacetelescope/WFC3Library) installation instructions.\n",
Copy link
Collaborator

@haticekaratay haticekaratay Nov 24, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your work. I've reviewed the current approach for moving files, and I have a suggestion that might streamline the process, especially considering the potential for repeated runs of the notebook. To ensure that we efficiently handle files that may already exist in the destination directory, I propose the following code:

os.makedirs('orig/', exist_ok=True)

for file_pattern in ['ibohbf*_ima.fits', 'ibohbf*_flt.fits', 'ibohbf*_drz.fits']:
  for file in glob.glob(file_pattern):
    destination_path = os.path.join('orig', os.path.basename(file))
    if os.path.isfile(destination_path):
      os.remove(destination_path)
    shutil.move(file, destination_path)  



Reply via ReviewNB

FDauphin and others added 2 commits November 27, 2023 16:19
@FDauphin
Copy link
Contributor

FDauphin commented Nov 27, 2023

@haticekaratay Thanks for the comments. I've integrated them into the notebook. However, now I have an error in the Greetings check, which I am unfamiliar with. What should I change so it passes? Thanks for the help.

Copy link
Collaborator

@haticekaratay haticekaratay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your work @FDauphin. The Action greetings can be ignored for our case, and it's been reported to the CI team.

@haticekaratay haticekaratay merged commit 0a07a7c into main Nov 28, 2023
5 of 6 checks passed
@mgough-970 mgough-970 deleted the add_wfc3_calwf3_recalibration_notebook branch December 6, 2023 16:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
WFC3 Wide Field Camera 3
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants